<?php  
class ControllerCommonColumnLeft extends Controller {
	protected function index() {
		$this->language->load('common/column_left');
		
		$this->data['note'] = $this->language->get('note');
		
		$this->load->model('catalog/category');
		
		$parents = $this->model_catalog_category->getCategoryByParent(0);
		
		$this->data['categories'] = array();
		
		foreach ($parents as $parent){
			$array = array();
			
			$array[] = $parent;
			
			$this->load->model('support/needs');
			$array[] = $this->model_support_needs->getNeedsByCategory($parent['category_id'], $parent['all']);
			
			$this->load->model('support/kind_classifieds');
			$array[] = $this->model_support_kind_classifieds->getKindByCategory($parent['category_id']);
			
			$this->data['categories'][] = $array;
		}
		
		$this->id = 'column_left';

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/column_left.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/common/column_left.tpl';
		} else {
			$this->template = 'default/template/common/column_left.tpl';
		}
		
		$this->render();
	}
}
?>